package com.java.service.impl;

import java.util.Date;  

import javax.jws.WebParam;  
import javax.jws.WebService;  
import javax.jws.soap.SOAPBinding;  
import javax.jws.soap.SOAPBinding.Style;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.java.entity.User;  
import com.java.service.IUserService;  
  
/** 
 * <b>function:</b> WebService传递复杂对象，如JavaBean、Array、List、Map等 
 */  
@WebService  
@SOAPBinding(style = Style.RPC)  
public class UserServiceImpl implements IUserService {  
	private static final Logger logger = LoggerFactory.getLogger(UserServiceImpl.class);
	@Override
    public User getUserByName(@WebParam(name = "name") String name) {  
        User user = new User();  
        user.setId(new Date().getTime());  
        user.setName(name);  
        user.setAddress("china");  
        user.setEmail(name + "@test.com");  
        logger.debug("############UserServiceImpl getUserByName###########");
        logger.debug("setUser:" + user.toString()); 
        return user;  
    }  
	
	@Override
    public void setUser(User user) {  
        logger.debug("############UserServiceImpl setUser###########");  
        logger.debug("setUser:" + user.toString());  
    }  

	@Override
	public String sayHi(String text) {
		logger.debug("############UserServiceImpl sayHi###########"); 
		logger.debug("Hi" + text);  
        return "Hi" + text;
	}  
}  